#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
using namespace std;


class Solution{
    public:
    Solution(){
        min_stk.push(INT32_MAX);
    }

    void push(int val){
        stk.push(val);
        min_stk.push(min(min_stk.top(), val));
    }

    void pop(){
        stk.pop();
        min_stk.pop();
    }

    int top(){
        return stk.top();
    }

    int getMin(){
        return min_stk.top();
    }


    private:
    stack<int> stk;
    stack<int> min_stk;
};

void test1(){
    Solution* stk = new Solution();
    stk->push(-2);
    stk->push(0);
    stk->push(-3);
    cout << stk->getMin() << endl;
    stk->pop();
    cout << stk->top() << endl;
    cout << stk->getMin() << endl;
}



int main(void){
    test1();

    return 0;
}